import QtQuick 2.3
import QtQuick.Controls 1.2
import QmlObjectTest 1.0
import MyCommon 1.0

//1.入侵qq群 310624686
//2.管理员qq 973504660
//3.入侵邮箱973504660@qq.com 123456789
//4.最新邮件，网站https://qtdream.com/
//5.入侵网站，973504660@qq.com admin

ApplicationWindow {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    menuBar: MenuBar {
        Menu {
            title: qsTr("File")
            MenuItem {
                text: qsTr("&Open")
                onTriggered: console.log("Open action triggered");
            }
            MenuItem {
                text: qsTr("Exit")
                onTriggered: Qt.quit();
            }
        }
    }

    QmlObjectTest{
        id: qmlObjectTest
    }
    MyCommon{
        id: myCommon
    }

    Text {
        id: title
        anchors.horizontalCenter: btnRestart.horizontalCenter
        font.bold: true
        y: 50
        text: qsTr("黑客小游戏")
        font.pixelSize: 100
    }

    Image{
        id: btnRestart
        anchors.centerIn: parent
        source: "qrc:/btn.png"
        z: 10
        Text {
            id: name
            anchors.centerIn: parent
            text: qsTr("加群")
            font.pixelSize: 60
        }

        MouseArea{
            anchors.fill: parent
            onPressed: {
                //310624686
                //b_hhiJiatqQz7g4RRXo4bs6e2-u5cVpv
                myCommon.addQQ("b_hhiJiatqQz7g4RRXo4bs6e2-u5cVpv")
            }
        }
    }

    //qml console分类与c++的QDebug对应关系
    //console.debug,log —— QtDebugMsg
    //console.warn —— QtWarningMsg
    //console.error —— QtCriticalMsg
    //console.info —— QtInfoMsg
    //console.? —— QtFatalMsg

    Row{
        visible: false
        Column{
            spacing: 5
            Button{
                text: "qml"
            }
            Button{
                text: "debug"
                onClicked: console.debug("[your qml log level is *"+text+"*]")
            }
            Button{
                text: "warning"
                onClicked: console.warn("[your qml log level is *"+text+"*]")
            }
            Button{
                text: "cirtical"
                onClicked: console.error("[your qml log level is *"+text+"*]")
            }
            Button{
                text: "fatal"
                onClicked: console.error("[your qml log level is *"+text+"*]")
            }
            Button{
                text: "info"
                onClicked: console.info("[your qml log level is *"+text+"*]")
            }
        }

        Column{
            spacing: 5
            Button{
                text: "c++"
            }
            Button{
                text: "debug"
                onClicked: qmlObjectTest.printLog(QmlObjectTest.QtDebugMsgTest, "")
            }
            Button{
                text: "warning"
                onClicked: qmlObjectTest.printLog(QmlObjectTest.QtWarningMsgTest, "")
            }
            Button{
                text: "cirtical"
                onClicked: qmlObjectTest.printLog(QmlObjectTest.QtCriticalMsgTest, "")
            }
            Button{
                text: "fatal"
                onClicked: qmlObjectTest.printLog(QmlObjectTest.QtFatalMsgTest, "")
            }
            Button{
                text: "info"
                onClicked: qmlObjectTest.printLog(QmlObjectTest.QtInfoMsgTest, "")
            }
        }
    }

}

